spmdm.cpp